package demo;

public class Demo2 {
    public static void main(String[] args) throws InterruptedException {
        Object locker=new Object();
        Thread t=new Thread(()->{
            //结果打印t，因为synchronized是一个可重入锁
            synchronized (locker){
                synchronized (locker){
                    System.out.println("t");
                }
            }
        });
        t.start();
        t.join();
    }
}
